<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclimageformat.cpp -->
  <title>QCLImageFormat Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLImageFormat</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLImageFormat Class Reference</h1>
<!-- $$$QCLImageFormat-brief -->
<p>The QCLImageFormat class represents the format of a <a href="qclimage2d.html">QCLImage2D</a> or <a href="qclimage3d.html">QCLImage3D</a>. <a href="#details">More...</a></p>
<!-- @@@QCLImageFormat -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLImageFormat&gt;</pre><p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qclimageformat-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#ChannelOrder-enum">ChannelOrder</a></b> { Order_R, Order_A, Order_RG, Order_RA, ..., Order_RGBx }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#ChannelType-enum">ChannelType</a></b> { Type_Normalized_Int8, Type_Normalized_Int16, Type_Normalized_UInt8, Type_Normalized_UInt16, ..., Type_Float }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#QCLImageFormat">QCLImageFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#QCLImageFormat-2">QCLImageFormat</a></b> ( QCLImageFormat::ChannelOrder <i>order</i>, QCLImageFormat::ChannelType <i>type</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#QCLImageFormat-3">QCLImageFormat</a></b> ( QImage::Format <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImageFormat::ChannelOrder </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#channelOrder">channelOrder</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImageFormat::ChannelType </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#channelType">channelType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QImage::Format </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#toQImageFormat">toQImageFormat</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#operator-not-eq">operator!=</a></b> ( const QCLImageFormat &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclimageformat.html#operator-eq-eq">operator==</a></b> ( const QCLImageFormat &amp; <i>other</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QCLImageFormat-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLImageFormat class represents the format of a <a href="qclimage2d.html">QCLImage2D</a> or <a href="qclimage3d.html">QCLImage3D</a>.</p>
<p>QImage formats are mapped to OpenCL image formats as follows:</p>
<table class="generic">
<thead><tr class="qt-style topAlign"><th >QImage format</th><th >Channel order</th><th >Channel type</th></tr></thead>
<tr class="odd topAlign"><td ><p>QImage::Format_Indexed8</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_A</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_UInt8</a></p></td></tr>
<tr class="even topAlign"><td ><p>QImage::Format_RGB32</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_BGRA</a> or <a href="qclimageformat.html#ChannelOrder-enum">Order_ARGB</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_UInt8</a></p></td></tr>
<tr class="odd topAlign"><td ><p>QImage::Format_ARGB32</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_BGRA</a> or <a href="qclimageformat.html#ChannelOrder-enum">Order_ARGB</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_UInt8</a></p></td></tr>
<tr class="even topAlign"><td ><p>QImage::Format_ARGB32_Premultiplied</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_BGRA</a> or <a href="qclimageformat.html#ChannelOrder-enum">Order_ARGB</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_UInt8</a></p></td></tr>
<tr class="odd topAlign"><td ><p>QImage::Format_RGB16</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_RGB</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_565</a></p></td></tr>
<tr class="even topAlign"><td ><p>QImage::Format_RGB555</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_RGB</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_555</a></p></td></tr>
<tr class="odd topAlign"><td ><p>QImage::Format_RGB888</p></td><td ><p><a href="qclimageformat.html#ChannelOrder-enum">Order_RGB</a></p></td><td ><p><a href="qclimageformat.html#ChannelType-enum">Type_Normalized_UInt8</a></p></td></tr>
</table>
<p><a href="qclimageformat.html#ChannelOrder-enum">Order_BGRA</a> is used on little-endian systems for 32-bit pixel formats, and <a href="qclimageformat.html#ChannelOrder-enum">Order_ARGB</a> on big-endian systems. QImage::Format_Indexed8 is mapped to an alpha-only image format to make it easier to convert font glyphs into OpenCL images. OpenCL does not otherwise support indexed palettes. All other formats result in a null QCLImageFormat object.</p>
<p>It isn't possible to distinguish between QImage::Format_RGB32, QImage::Format_ARGB32, and QImage::Format_ARGB32_Premultiplied based on the OpenCL format parameters. It is up the OpenCL kernels that operate on the image data to interpret the data appropriately. If the QCLImageFormat was constructed from a QImage format, then the object will remember whether the format was QImage::Format_RGB32, QImage::Format_ARGB32, or QImage::Format_ARGB32_Premultiplied.</p>
</div>
<!-- @@@QCLImageFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ChannelOrder$$$Order_R$$$Order_A$$$Order_RG$$$Order_RA$$$Order_RGB$$$Order_RGBA$$$Order_BGRA$$$Order_ARGB$$$Order_Intensity$$$Order_Luminence$$$Order_Rx$$$Order_RGx$$$Order_RGBx -->
<h3 class="fn"><a name="ChannelOrder-enum"></a>enum QCLImageFormat::ChannelOrder</h3>
<p>This enum defines the order of R, G, B, and A channels in an image.</p>
<table class="valuelist"><tr class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_R</tt></td><td class=" topAlign"><tt>0x10B0</tt></td><td  class="topAlign">Single red channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_A</tt></td><td class=" topAlign"><tt>0x10B1</tt></td><td  class="topAlign">Single alpha channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_RG</tt></td><td class=" topAlign"><tt>0x10B2</tt></td><td  class="topAlign">Red then green channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_RA</tt></td><td class=" topAlign"><tt>0x10B3</tt></td><td  class="topAlign">Red then alpha channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_RGB</tt></td><td class=" topAlign"><tt>0x10B4</tt></td><td  class="topAlign">Red, green, and blue channels.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_RGBA</tt></td><td class=" topAlign"><tt>0x10B5</tt></td><td  class="topAlign">Red, green, blue, then alpha channels.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_BGRA</tt></td><td class=" topAlign"><tt>0x10B6</tt></td><td  class="topAlign">Blue, green, red, then alpha channels.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_ARGB</tt></td><td class=" topAlign"><tt>0x10B7</tt></td><td  class="topAlign">Alpha, red, green, then blue channels.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_Intensity</tt></td><td class=" topAlign"><tt>0x10B8</tt></td><td  class="topAlign">Single intensity channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_Luminence</tt></td><td class=" topAlign"><tt>0x10B9</tt></td><td  class="topAlign">Single luminence channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_Rx</tt></td><td class=" topAlign"><tt>0x10BA</tt></td><td  class="topAlign">Red channel plus an ignored channel. This value is an optional channel order in OpenCL 1.1, and is not supported by OpenCL 1.0&#x2e;</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_RGx</tt></td><td class=" topAlign"><tt>0x10BB</tt></td><td  class="topAlign">Red and green channels plus an ignored channel. This value is an optional channel order in OpenCL 1.1, and is not supported by OpenCL 1.0&#x2e;</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Order_RGBx</tt></td><td class=" topAlign"><tt>0x10BC</tt></td><td  class="topAlign">Red, green, and blue channels, plus an ignored channel. This value is an optional channel order in OpenCL 1.1, and is not supported by OpenCL 1.0&#x2e;</td></tr>
</table>
<!-- @@@ChannelOrder -->
<!-- $$$ChannelType$$$Type_Normalized_Int8$$$Type_Normalized_Int16$$$Type_Normalized_UInt8$$$Type_Normalized_UInt16$$$Type_Normalized_565$$$Type_Normalized_555$$$Type_Normalized_101010$$$Type_Unnormalized_Int8$$$Type_Unnormalized_Int16$$$Type_Unnormalized_Int32$$$Type_Unnormalized_UInt8$$$Type_Unnormalized_UInt16$$$Type_Unnormalized_UInt32$$$Type_Half_Float$$$Type_Float -->
<h3 class="fn"><a name="ChannelType-enum"></a>enum QCLImageFormat::ChannelType</h3>
<p>This enum defines the representation type for an image channel.</p>
<table class="valuelist"><tr class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_Int8</tt></td><td class=" topAlign"><tt>0x10D0</tt></td><td  class="topAlign">Signed 8-bit integer, normalized to the range -1.0 to 1.0&#x2e;</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_Int16</tt></td><td class=" topAlign"><tt>0x10D1</tt></td><td  class="topAlign">Signed 8-bit integer, normalized to the range -1.0 to 1.0&#x2e;</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_UInt8</tt></td><td class=" topAlign"><tt>0x10D2</tt></td><td  class="topAlign">Unsigned 8-bit integer, normalized to the range 0.0 to 1.0&#x2e;</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_UInt16</tt></td><td class=" topAlign"><tt>0x10D3</tt></td><td  class="topAlign">Unsigned 16-bit integer, normalized to the range 0.0 to 1.0&#x2e;</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_565</tt></td><td class=" topAlign"><tt>0x10D4</tt></td><td  class="topAlign">RGB565 representation.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_555</tt></td><td class=" topAlign"><tt>0x10D5</tt></td><td  class="topAlign">RGB555 representation.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Normalized_101010</tt></td><td class=" topAlign"><tt>0x10D6</tt></td><td  class="topAlign">RGB-10-10-10 representation with 10 bits of precision for each channel.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Unnormalized_Int8</tt></td><td class=" topAlign"><tt>0x10D7</tt></td><td  class="topAlign">Unnormalized signed 8-bit integer.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Unnormalized_Int16</tt></td><td class=" topAlign"><tt>0x10D8</tt></td><td  class="topAlign">Unnormalized signed 16-bit integer.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Unnormalized_Int32</tt></td><td class=" topAlign"><tt>0x10D9</tt></td><td  class="topAlign">Unnormalized signed 32-bit integer.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Unnormalized_UInt8</tt></td><td class=" topAlign"><tt>0x10DA</tt></td><td  class="topAlign">Unnormalized unsigned 8-bit integer.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Unnormalized_UInt16</tt></td><td class=" topAlign"><tt>0x10DB</tt></td><td  class="topAlign">Unnormalized unsigned 16-bit integer.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Unnormalized_UInt32</tt></td><td class=" topAlign"><tt>0x10DC</tt></td><td  class="topAlign">Unnormalized unsigned 32-bit integer.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Half_Float</tt></td><td class=" topAlign"><tt>0x10DD</tt></td><td  class="topAlign">Half-precision floating-point value.</td></tr>
<tr><td  class="topAlign"><tt>QCLImageFormat::Type_Float</tt></td><td class=" topAlign"><tt>0x10DE</tt></td><td  class="topAlign">Single-precision floating-point value.</td></tr>
</table>
<!-- @@@ChannelType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLImageFormat[overload1]$$$QCLImageFormat -->
<h3 class="fn"><a name="QCLImageFormat"></a>QCLImageFormat::QCLImageFormat ()</h3>
<p>Constructs a null OpenCL image format descriptor.</p>
<p>See also <a href="qclimageformat.html#isNull">isNull</a>().</p>
<!-- @@@QCLImageFormat -->
<!-- $$$QCLImageFormat$$$QCLImageFormatQCLImageFormat::ChannelOrderQCLImageFormat::ChannelType -->
<h3 class="fn"><a name="QCLImageFormat-2"></a>QCLImageFormat::QCLImageFormat ( <a href="qclimageformat.html#ChannelOrder-enum">QCLImageFormat::ChannelOrder</a> <i>order</i>, <a href="qclimageformat.html#ChannelType-enum">QCLImageFormat::ChannelType</a> <i>type</i> )</h3>
<p>Constructs an OpenCL image format descriptor from <i>order</i> and <i>type</i>.</p>
<p>This constructor will infer the closest matching QImage format to return from <a href="qclimageformat.html#toQImageFormat">toQImageFormat</a>(), which may be QImage::Format_Invalid if <i>order</i> and <i>type</i> do not correspond to a QImage format.</p>
<!-- @@@QCLImageFormat -->
<!-- $$$QCLImageFormat$$$QCLImageFormatQImage::Format -->
<h3 class="fn"><a name="QCLImageFormat-3"></a>QCLImageFormat::QCLImageFormat ( QImage::Format <i>format</i> )</h3>
<p>Constructs an OpenCL image format descriptor that is equivalent to the specified QImage <i>format</i>. If the <i>format</i> does not have an OpenCL equivalent, the descriptor will be set to null.</p>
<p>See also <a href="qclimageformat.html#isNull">isNull</a>() and <a href="qclimageformat.html#toQImageFormat">toQImageFormat</a>().</p>
<!-- @@@QCLImageFormat -->
<!-- $$$channelOrder[overload1]$$$channelOrder -->
<h3 class="fn"><a name="channelOrder"></a><a href="qclimageformat.html#ChannelOrder-enum">QCLImageFormat::ChannelOrder</a> QCLImageFormat::channelOrder () const</h3>
<p>Returns the order of channels in this OpenCL image format.</p>
<p>See also <a href="qclimageformat.html#channelType">channelType</a>().</p>
<!-- @@@channelOrder -->
<!-- $$$channelType[overload1]$$$channelType -->
<h3 class="fn"><a name="channelType"></a><a href="qclimageformat.html#ChannelType-enum">QCLImageFormat::ChannelType</a> QCLImageFormat::channelType () const</h3>
<p>Returns the representation type for channels in this OpenCL image format.</p>
<p>See also <a href="qclimageformat.html#channelOrder">channelOrder</a>().</p>
<!-- @@@channelType -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a>bool QCLImageFormat::isNull () const</h3>
<p>Returns true if this OpenCL image format descriptor is null.</p>
<!-- @@@isNull -->
<!-- $$$toQImageFormat[overload1]$$$toQImageFormat -->
<h3 class="fn"><a name="toQImageFormat"></a>QImage::Format QCLImageFormat::toQImageFormat () const</h3>
<p>Returns the nearest QImage format to this OpenCL image format; QImage::Format_Invalid if there is no corresponding QImage format.</p>
<!-- @@@toQImageFormat -->
<!-- $$$operator!=[overload1]$$$operator!=constQCLImageFormat& -->
<h3 class="fn"><a name="operator-not-eq"></a>bool QCLImageFormat::operator!= ( const QCLImageFormat &amp; <i>other</i> )</h3>
<p>Returns true if this image format is not the same as <i>other</i>; false otherwise.</p>
<p>See also <a href="qclimageformat.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constQCLImageFormat& -->
<h3 class="fn"><a name="operator-eq-eq"></a>bool QCLImageFormat::operator== ( const QCLImageFormat &amp; <i>other</i> )</h3>
<p>Returns true if this image format is the same as <i>other</i>; false otherwise.</p>
<p>See also <a href="qclimageformat.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
